import Vue from 'vue'
import Router from 'vue-router'
import homePage from '@/components/homePage'
import myActivity from '@/components/myActivity'
import myTemplate from '@/components/myTemplate'
import setActivityTemplate from '@/components/setActivityTemplate'
import playersInfo from '@/components/playersInfo'
import createTemplate from '@/components/createTemplate'
import isActivityStart from '@/components/isActivityStart'
import playerRank from '@/components/playerRank'
import NotFoundComponent from '@/components/NotFoundComponent'
import help from '@/components/help'
import gameResult from '@/components/gameResult'
import activityInfo from '@/components/activityInfo'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    { path: '*', component: NotFoundComponent },
    {
      path: '/',
      name: 'default',
      redirect: '/homePage'
    },
    {
      path: '/help',
      name: 'help',
      component: help,
      meta: {
        requireAuth: false // 添加该字段，表示进入这个路由是否需要登录的
      }
    },
    {
      path: '/homePage',
      name: 'homePage',
      component: homePage,
      meta: {
        requireAuth: false // 添加该字段，表示进入这个路由是否需要登录的
      }
    },
    {
      path: '/myActivity',
      name: 'myActivity',
      component: myActivity,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/activityInfo',
      name: 'activityInfo',
      component: activityInfo,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/myTemplate',
      name: 'myTemplate',
      component: myTemplate,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/setActivityTemplate',
      name: 'setActivityTemplate',
      component: setActivityTemplate,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/playersInfo',
      name: 'playersInfo',
      component: playersInfo,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/createTemplate',
      name: 'createTemplate',
      component: createTemplate,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/isActivityStart',
      name: 'isActivityStart',
      component: isActivityStart,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/playerRank',
      name: 'playerRank',
      component: playerRank,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/gameResult',
      name: 'gameResult',
      component: gameResult
    }
  ]
})
